#ifndef ORDERDATAACCESS_H
#define ORDERDATAACCESS_H
#include <QSqlQuery>
#include <QString>
#include <QMap>
#include <QList>
#include <QSqlError>
#include <QDateTime>
#include "dal/persistence/DbConnector.h"
#include "entity/Order.h"
#include "entity/OrderDetail.h"
// 订单数据访问类
class OrdersDataAccess
{
public:
    // 显示所有订单
    static QList<Order> getOrders(const int &userId);
    // 获取订单详情
    static QList<OrderDetail> getOrderDetails(const int &orderId);
    // 创建订单功能
    static int creatOrder(const int &userId, const QDateTime &orderDate, const double &totalAmount, const QString &name, const QString &phone, const QString &address);
    // 添加订单详情
    static bool addOrderDetail(const int &orderId, const int &productId, const int &quantity, const int &price);
};

#endif // ORDERDATAACCESS_H
